package com.sanshi.project.admin.api.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.github.yulichang.annotation.EntityMapping;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 打印模版配置表
 *
 * @author nikon
 * @date 2023-11-16 16:22:01
 */
@Data
@TableName("print_template")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "打印模版配置表")
public class PrintTemplateEntity extends Model<PrintTemplateEntity> {


    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    /**
     * 名称
     */
    @Schema(description = "名称")
    private String name;

    /**
     * 业务类型
     */
    @Schema(description = "业务类型")
    private String type;

    /**
     * 是否双面打印
     */
    @Schema(description = "是否双面打印")
    private String duplex;

    /**
     * 内容
     */
    @Schema(description = "内容")
    private String content;

    /**
     * 状态
     */
    @Schema(description = "状态")
    private String status;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 文件
     */
    @Schema(description = "文件")
    private String file;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新人")
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 删除标记[0未删除，1已删]
     */
    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @Schema(description = "删除标记[0未删除，1已删]")
    private String delFlag;

    /**
     * 租户号
     */
    @Schema(description = "租户号")
    private Long tenantId;
    
    @ExcelIgnore
    @TableField(exist = false)
    @EntityMapping(thisField = "type", joinField = "type")
    private List<PrintItemEntity> printItemList;
}